﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int N;
            bool Pr = false;
            Console.Write("Введите число -> ");
            N = Convert.ToInt32(Console.ReadLine());
            while (N != 0)
            {

                int a;
                a = N % 10;
                N /= 10;
                if (a == 2)
                {

                    Pr = true;
                    Console.WriteLine(Pr);
                    Console.ReadKey();
                    break;
                }

            }
            Console.WriteLine(Pr);
            Console.ReadKey();
                       
        }
    }
}
